This page describes the steps to set up node.js.
Node.js allows you to run javascript at the back-end, i.e. on a web server or you computer. This contrasts with running javascript in the browser.
Node.js provides a wealth of functionlity that would not be available if we restrict ourselves to running javascript in the browser.
Download and install node from here:
node.jsInstall the LTS version.
You can choose all the default options when you install it.
You will need an IDE (Integrated Development Environment) to edit your code. I like to use Visual Studio Code, but there are numerous other options.
To install Visual Studio Code, go here:
Visual Studio CodeCreate a new folder called "hello" on your desktop.
Start up Visual Studio Code (VS Code):
Open the "hello" folder in VS Code by either selecting it using the File->Open Folder menu or dragging the hello folder into VS Code. You should see the folder open in the explorer in VS Code:
Click on the new file icon:
Create a file called hello.js:
Enter code as follows into the file:
Save the file, then start the terminal using the Terminal->New Terminal menu. You should see something like this:
Type "node hello.js" into the terminal:
Then hit ENTER. You should see the message "Hello World" show in ther terminal:
Congratulations, you've written your first node.js code!
Glitch is a hosting platform for running node.js applications in the cloud. You can edit your code directly in the browser and run your application on Glitch's servers. You can even share your application instantly. It's a nice alternative to installing node.js and an IDE on your local computer.
Find out more about Glitch here:
Glitch